package com.mvp.shq.washer.ui.home;

import com.mvp.shq.washer.entity.Banner;
import com.mvp.shq.washer.entity.OrderInfo;
import com.mvp.shq.washer.entity.result.BaseResult;
import com.mvp.shq.washer.entity.result.WasherInfoResult;
import com.mvp.shq.washer.http.Api;
import com.mvp.shq.washer.http.RxSchedulers;

import java.util.List;

import io.reactivex.Observable;

/**
 * Created by Administrator on 2017/8/19.
 */

public class HomeModel implements HomeConstract.Model {
    @Override
    public Observable<BaseResult<List<Banner>>> banner() {
        return Api.getInstance().service
                .banner()
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<WasherInfoResult>> getWasherInfo(String token, String washerNo) {
        return Api.getInstance().service
                .washerInfo(token,washerNo)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<OrderInfo>> getOrder(String token, String userId) {
        return Api.getInstance().service
                .getOrderBuUserId(token,userId)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<Integer>> getRestTime(String token, String orderNo) {
        return Api.getInstance().service
                .getRestTime(token,orderNo)
                .compose(RxSchedulers.io_main());
    }
}
